import { _decorator, Component, Node } from 'cc';
import { Dice } from './Dice';
import { MapStamp } from './MapStamp';
import { Size } from 'cc';
import { v2 } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('GameCanvas')
export class GameCanvas extends Component {
  @property(Dice)
  dice: Dice = null;

  @property(MapStamp)
  mapStamp: MapStamp = null;

  start() {
    const mapSize = new Size(8, 8);
    this.mapStamp.mapSize = mapSize;
    this.dice.moveRange = v2(mapSize.width, mapSize.height);
    const position = this.mapStamp.getPosition(0, 0);
    this.dice.baseLocation = position;
  }

  update(deltaTime: number) {

  }
}


